<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:form_composites="http://java.sun.com/jsf/composite/form_composites"
	xmlns:main_tree="http://java.sun.com/jsf/composite/main_tree"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<style type="text/css">
ui-widget,.ui-widget .ui-widget {
	font-size: 14px !important;
}

td {
	vertical-align: top;
}
</style>
</h:head>
<h:body>
	<h:form prependId="false">
		<p:confirmDialog
			message="Are you sure about deleting this node? All children will also be deleted"
			header="Initiating destroy process" severity="alert"
			widgetVar="confirmation">

			<p:commandButton id="confirm" value="Yes"
				update=":#{p:component('ldapTree')}"
				oncomplete="confirmation.hide()"
				actionListener="#{deleteLdapObjectBean.deleteNode()}" />
			<p:commandButton id="decline" value="No"
				onclick="confirmation.hide()" type="button" />
		</p:confirmDialog>
	</h:form>

	<h:form>
		<p:confirmDialog
			message="Are you sure about removing user from group?"
			header="Initiating destroy process" severity="alert"
			widgetVar="confirmRemoveUserFromGroupDialog">
			<p:commandButton value="Yes"
				update=":#{p:component('ldapGroupTree')}"
				oncomplete="confirmRemoveUserFromGroupDialog.hide()"
				actionListener="#{removeUserFromGroupBean.removeAllSubGroupsFromGroups()}" />
			<p:commandButton value="No"
				onclick="confirmRemoveUserFromGroupDialog.hide()" type="button" />
		</p:confirmDialog>
	</h:form>
	<h:form>
		<p:confirmDialog
			message="Are you sure about removing group from parent object? Parent will lose all inherited memberships"
			header="Initiating destroy process" severity="alert"
			widgetVar="confirmRemoveMemberOfDialog">
			<p:commandButton value="Yes" update=":#{p:component('ldapUserTree')}"
				oncomplete="confirmRemoveMemberOfDialog.hide()"
				actionListener="#{removeGroupFromGroupBean.removeGroupMemberOfRelation()}" />
			<p:commandButton value="No"
				onclick="confirmRemoveMemberOfDialog.hide()" type="button" />
		</p:confirmDialog>
	</h:form>
	<h:form>
		<p:confirmDialog
			message="Are you sure about removing group from parent group? Parent will lose all inherited memberships"
			header="Initiating destroy process" severity="alert"
			widgetVar="confirmRemoveGroupFromGroupDialog">
			<p:commandButton value="Yes"
				update=":#{p:component('ldapGroupTree')}"
				oncomplete="confirmRemoveGroupFromGroupDialog.hide()"
				actionListener="#{removeGroupFromGroupBean.removeGroupFromGroup()}" />
			<p:commandButton value="No"
				onclick="confirmRemoveGroupFromGroupDialog.hide()" type="button" />
		</p:confirmDialog>
	</h:form>
	<h:form>
		<p:confirmDialog
			message="Are you sure about removing all subgroup from the selected group? The group will lose all inherited memberships"
			header="Initiating destroy process" severity="alert"
			widgetVar="confirmRemoveAllSubgroupFromGroupDialog">
			<p:commandButton value="Yes"
				update=":#{p:component('ldapGroupTree')}"
				oncomplete="confirmRemoveAllSubgroupFromGroupDialog.hide()"
				actionListener="#{removeGroupFromGroupBean.removeAllSubGroupsFromGroups()}" />
			<p:commandButton value="No"
				onclick="confirmRemoveAllSubgroupFromGroupDialog.hide()"
				type="button" />
		</p:confirmDialog>
	</h:form>
	<p:layout fullPage="true">
		<p:layoutUnit size="500" position="west" resizable="true"
			closable="true" collapsible="true">
			<p:accordionPanel>

				<p:tab title="Ads Structure">
					<main_tree:adsTree />
				</p:tab>
				<p:tab title="Member-Tree">
					<main_tree:memberTree />
				</p:tab>
				<p:tab title="Member-Of Tree">
					<main_tree:memberOfTree />
				</p:tab>
				<p:tab title="DNS Managment">
					<main_tree:dnsTree />
				</p:tab>
			</p:accordionPanel>
		</p:layoutUnit>
		<p:layoutUnit position="center" resizable="true" id="center"
			closable="true" collapsible="true" effect="drop">
			<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />  
			
			<h:form id="#{createUserBean.pageName}">
				<form_composites:userForm beanToUse="#{createUserBean}" />
			</h:form>
			<h:form id="#{editUserBean.pageName}">
				<form_composites:userForm beanToUse="#{editUserBean}" />
			</h:form>
			<h:form id="#{createOUBean.pageName}">
				<form_composites:ouForm beanToUse="#{createOUBean}" />
			</h:form>
			<h:form id="#{editOUBean.pageName}">
				<form_composites:ouForm beanToUse="#{editOUBean}" />
			</h:form>
			<h:form id="#{createGroupBean.pageName}">
				<form_composites:groupForm beanToUse="#{createGroupBean}" />
			</h:form>
			<h:form id="#{editGroupBean.pageName}">
				<form_composites:groupForm beanToUse="#{editGroupBean}" />
			</h:form>
			<h:form id="#{createARecordBean.pageName}">
				<form_composites:aRecordForm beanToUse="#{createARecordBean}"/>
			</h:form>
			
			<h:form id="#{editARecordBean.pageName}">
				<form_composites:aRecordForm beanToUse="#{editARecordBean}"/>
			</h:form>
			<ui:include src="views/user.xml" />
			<ui:include src="views/group.xml" />
			<ui:include src="views/domaincontroller.xml" />
			<ui:include src="views/dnsRecord.xml" />
			<ui:include src="views/dnsCNameRecord.xml" />
			<!-- <ui:include src="views/forms/createGroup.xml" /> -->
			<!-- <ui:include src="views/forms/createOU.xml" /> -->
		</p:layoutUnit>

	</p:layout>
</h:body>
</html>